package org.meerkat.forum.client.maintree;

import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;

public class MainTreePanel extends TreePanel<MainTreeNode> {

	private static MainTreePanel instance;

	private MainTreePanel(TreeStore<MainTreeNode> store) {
		super(store);
	}

	public static MainTreePanel getInstance() {
		if (MainTreePanel.instance == null) {
			MainTreeStore treeStore = MainTreeStore.getMainTree();

			MainTreePanel treePanel = new MainTreePanel(treeStore);
			treePanel.setDisplayProperty("name");
			treePanel.setStyleAttribute("background-color", "#ffffff");

			MainTreePanel.instance = treePanel;
		}

		return MainTreePanel.instance;
	}
}
